export class PageParam{
  private _pageNum:number = 1;
  private _rows:number = 10;
  private _queryType:string = 'page';
  private _queryAll:boolean = false;
  private _sortName:string = '';
  private _sortFlag:string = '';
  private _queryJson:string = '';

  constructor(){
  }

  get pageNum(): number {
    return this._pageNum;
  }

  set pageNum(value: number) {
    this._pageNum = value;
  }

  get rows(): number {
    return this._rows;
  }

  set rows(value: number) {
    this._rows = value;
  }

  get queryType(): string {
    return this._queryType;
  }

  set queryType(value: string) {
    this._queryType = value;
  }

  get queryAll(): boolean {
    return this._queryAll;
  }

  set queryAll(value: boolean) {
    this._queryAll = value;
  }

  get sortName(): string {
    return this._sortName;
  }

  set sortName(value: string) {
    this._sortName = value;
  }

  get sortFlag(): string {
    return this._sortFlag;
  }

  set sortFlag(value: string) {
    this._sortFlag = value;
  }

  get queryJson(): string {
    return this._queryJson;
  }

  set queryJson(value: string) {
    this._queryJson = value;
  }

  toPageParamString():string{
    let realPageParam:any = {
      pageNum:this.pageNum,
      rows:this.rows,
      queryType:this.queryType,
      sortName:this.sortName,
      sortFlag:this.sortFlag,
      queryJson:this.queryJson
    }
    if(this.queryAll){
      realPageParam.widgetname = "page";
    }
    return JSON.stringify(realPageParam);
  }
}
